﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MPBlog.Model;
using NHibernate.Criterion;

namespace MPBlog.DAL
{
    public class SoftwareUseStatisticsDao : BaseDao<SoftwareUseStatistics>
    {
        /// <summary>
        /// 检查某个mac是否已经使用了某个software
        /// </summary>
        public int CheckHasExist(string mac,string software)
        {
            IList<SoftwareUseStatistics> list = GetList(Restrictions.Eq("Mac", mac), Restrictions.Eq("SoftwareName",software));
            if (list.Count > 0)
            {
                return list[0].Id;
            }
            return -1;
        }
    }
}
